<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Registro de Cuotas</title>
<link href="estilos.css" rel="stylesheet" type="text/css" />


<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>

<table  align="center" width="600" height="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#999999">
  <tr>
    <td>
	
	<table width="912" height="65" border="0" cellpadding="0" cellspacing="0">
  <p><strong>Lista de Cuotas de Gastos de Mantenimiento</strong></p>
  <tr>
    <th width="57" bgcolor="#CCCCCC" class="negrita" scope="col">Periodo</th>
    <th width="48" bgcolor="#CCCCCC" class="negrita" scope="col">Codigo Vivienda</th>
    <th width="89" bgcolor="#CCCCCC" class="negrita" scope="col">Ubicacion</th>
    <th width="92" bgcolor="#CCCCCC" class="negrita" scope="col">Cod Propietario</th>
    <th width="216" bgcolor="#CCCCCC" class="negrita" scope="col">Nombre del Propietario</th>
    <th width="120" bgcolor="#CCCCCC" class="negrita" scope="col">Importe Cuota</th>
    <th width="87" bgcolor="#CCCCCC" class="negrita" scope="col">Fecha Vencimiento</th>
    <th width="61" bgcolor="#CCCCCC" class="negrita" scope="col">Codigo Estado</th>
    <th width="52" bgcolor="#CCCCCC" class="negrita" scope="col">Estado</th>
    <th width="156" bgcolor="#CCCCCC" class="negrita" scope="col">Fecha Pago</th>
  </tr>

<%@page import="java.util.*, condominio.modelo.Cuota" %>
<%
Collection<Cuota> arreglo = (ArrayList<Cuota>)request.getAttribute("listadocuotas");
if(arreglo != null) {
int i = 1;
for(Cuota objCuotaJsp : arreglo) {
%>
  <tr>
    <td class="columna"><% out.print(objCuotaJsp.getStrPeriodo()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getIntVivienda()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getStrViviendaNro()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getIntPropietarioId()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getStrPropietarioNom()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getNumImporte()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getStrFechaVcto()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getChrEstadoCuota()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getStrEstadoDesc()); %></td>
    <td class="columna"><% out.print(objCuotaJsp.getStrFechaPago()); %></td>
  </tr>
<% }
  } %>

</table>

<form action="GrabarCuotaServlet" method="post" name="form1" id="form1" onSubmit="MM_validateForm('textfield1','','R','textfield2','','R','textfield3','','R','textfield4','','R');return document.MM_returnValue">
  <p class="subtitulo"><strong>Ingreso de Cuotas de Mantenimiento del Condominio</strong></p>
  <table width="400" border="0" cellspacing="2" cellpadding="2">
    <tr>
      <td>Ingrese el Periodo:</td>
      <td><label>
        <input type="text" name="fldperiodo" id="textfield1" />
      </label></td>
    </tr>
    <tr>
      <td>Ingrese el codigo de Vivienda:</td>
      <td><label>
        <input type="text" name="fldidvivienda" id="textfield2" />
      </label></td>
    </tr>
    <tr>
      <td>Ingrese el importe:</td>
      <td>
        <input type="text" name="fldimporte" id="textfield3" class="rightJustified" value="0.00"/>
      </td>
    </tr>
    <tr>
      <td>Ingrese la fecha de vencimiento:</td>
      <td><label>
        <input type="text" name="fldfechavencimiento" id="textfield4" />
      </label></td>
    </tr>
    <tr>
      <td>Codigo de Estado a asignar:</td>
      <td>
        <p>E - Emitido</p>
      </td>
    </tr>
    <tr>
      <td colspan="2"><label>
        <div align="right">
          <input type="submit" name="button" id="button" value="Registrar" />
        </div>
      </label></td>
    </tr>
  </table>
</form>
	
	</td>
  </tr>
</table>




</body>
</html>